#pragma once

#include <vector>
#include <string>
#include "Agent.h"
#include "Action.h"
#include "GameTime.h"
#include <windows.h>
#include <sstream>
#include <iostream>

namespace BAA {

	//event needs to be merged with gavan's code
	class World;
	typedef std::vector<Agent*>	AgentVector;

	class Event
	{
	public:
		Event(Agent * source, std::vector<Agent*> * targets, 
			std::vector<Agent*> * agentsInvolved,
			int urgency, int priority, Action * action);
		~Event(void);
		std::string getDescription();
		void testClass();

#pragma region Accessors
		std::vector<Agent *> * getAgentsInvolved();
		std::vector<Agent *> * getTargets();
		int getUrgency();
		int getPriority();
		int getEventID();
		Agent * getSource();
		Action * getAction();
		__int64 getTimestamp();
		StringFloatMap * getConsequences(){ return consequences; }
		Agent * getTrigger(){ return trigger; }

		void addInvolvedAgent(Agent * a);
		void addTarget(Agent * a);
		void setUrgency(int urg);
		void setPriority(int pri);
		void setAction(Action * type);
#pragma endregion

	private:
		Agent * source;							//may be null; if null, source = unknown
		std::vector<Agent *> * agentsInvolved;
		int urgency;
		int priority;
		std::vector<Agent *> * targets;
		// what action was performed
		Action * action;
		int event_id;
		__int64 timeStamp;						//timestamp in ms of event creation
		World * world;
		// time
		GameTime time;
		// who caused the event
		Agent  * trigger;
		// as list of consequences.
		StringFloatMap  * consequences;

		static int event_counter;
	};

}